<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace addons\config\model;

/**
 * Description of Crontab
 * 
 * @author zmh
 */
class Crontab extends \web\common\model\BaseModel {

    protected function _initialize() {
        $this->tableName = 'crontab';
    }

    
    /**
     * 增加定时
     */
    public function addCrontab($user_id,$amount,$cny_amount,$rate,$method,$buy_id=0,$order_id=0){
    	$data = [
    		'user_id'=>$user_id,
            'amount'=>$amount,
            'cny_amount'=>$cny_amount,
            'rate'=>$rate,
            'method'=>$method,
            'buy_user_id'=>$buy_id,
    		'order_id'=>$order_id,
    		'create_time'=>NOW_DATETIME,
    		'update_time'=>NOW_DATETIME,
    		'status'=>0
    	];
    	return $this->add($data);
    }
    

}
